package com.hmall.cart;

import com.hmall.api.client.ItemClient;
import com.hmall.api.config.DefaultFeignConfig;
import com.hmall.cart.config.OpenFeignConfig;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.loadbalancer.annotation.LoadBalancerClients;
import org.springframework.cloud.openfeign.EnableFeignClients;

//修改负载均衡算法
@LoadBalancerClients(defaultConfiguration = OpenFeignConfig.class)
//开启OpenFeign功能，可以扫描到那些Feign客户端
//@EnableFeignClients(clients = {ItemClient.class})
//basePackages 扫描feign客户端的包路径；  defaultConfiguration feign的配置类（日志记录级别）
@EnableFeignClients(basePackages = "com.hmall.api.client", defaultConfiguration = DefaultFeignConfig.class)
@MapperScan("com.hmall.cart.mapper")
@SpringBootApplication
public class CartApplication {
    public static void main(String[] args) {
        SpringApplication.run(CartApplication.class, args);
    }
}
